import time

from Page.page_login_ht import HTLogin
from Page.page_review_aplay import ReviewAplay
from Tools.tools import DriverTools
from script import log


class TestReviewAplay(object):
    def setup_method(self):
        driver = DriverTools.get_driver()
        driver.get("http://121.43.169.97:8082/")
        self.login = HTLogin(driver)
        self.review=ReviewAplay(driver)

    def teardown_method(self):
        DriverTools.close_driver()

    def test_review_aplay(self):
        self.login.HTLogin("admin", "HM_2023_test", "8888")
        # 切换页面操作：iframe
        self.review.review_aplay_serch("18738142070")
        self.review.review_aplay_pass("可以通过","8888")
        result = self.review.assert_review_aplay_pass()
        log.info(f"执行结果{result}")
        assert "审核成功" == result

        self.review.get_shot("通过审核.png")
        time.sleep(3)
